﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data;

namespace ORS.BLL
{
    public class reviewhandle
    {
        private int _paperid=0;
        public int Paperid
        {
            get { return _paperid; }
            set { _paperid = value; }
        }

        private int _reviewstate;
        public int Reviewstate
        {
            get { return _reviewstate; }
            set { _reviewstate = value; }
        }

        private DateTime _reviewdate;
        public DateTime Reviewdate
        {
            get { return _reviewdate; }
            set {_reviewdate = value; }
        }

        private string _reviewcomm;
        public string Reviewcomm
        {
            get { return _reviewcomm; }
            set { _reviewcomm = value; }
        }

        private string _reviewer;
        public string Reviewer
        {
            get { return _reviewer; }
            set { _reviewer = value; }
        }

        public void setReviewHistory()
        {
            _reviewdate = DateTime.Now;
            string reviewsqlstr1 = "insert into tb_reviewhistory (paperid,reviewstate,reviewdate,reviewcomm) values (" + _paperid + "," + _reviewstate + ",'" + _reviewdate + "','" + _reviewcomm + "')";
            string reviewsqlstr2 = "update tb_paperinfo set reviewer = '" + _reviewer + "' where paperid = "+_paperid+"";
            ORS.DAL.DBHelper db = new ORS.DAL.DBHelper();
            db.setDate(reviewsqlstr1);
            db.setDate(reviewsqlstr2);
        }

        //public DataTable getReviewHistory(string uid, int reviewstate)
        //{
        //    string reviewsqlstr = "select * from tb_review";
        //    ORS.DAL.DBHelper reviewdb = new ORS.DAL.DBHelper();
        //    DataSet reviewds = new DataSet();
        //    reviewds = reviewdb.getDateSet(reviewsqlstr);
        //    return reviewds.Tables[0];
        //}
    }
}